package com.wanmait.demo.webcontroller.usercontroller.personalController;

import com.wanmait.demo.pojo.Userinfo;
import com.wanmait.demo.service.UserService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

@Controller
//@RequestMapping("/changepasswordpager")
public class UserInfoController {
    @Resource
    private UserService userService;
    @ModelAttribute("loginUser")
    @RequestMapping("/user/personalCenter/order/user")
    public Userinfo toPersonCenter(HttpServletRequest request){


        /////////////////////////////////////////////////////////////////
        HttpSession session =request.getSession();
        Userinfo loginUser=(Userinfo)session.getAttribute("loginUser");
//        Integer userid=loginUser.getId();

        return userService.getUserInfoForPersonCenter(loginUser.getId());

    }
    @RequestMapping("user/personalCenter/order/index")
    public void toIndex(){

    }
    @RequestMapping("user/personalCenter/order/hudong")
    public void toHudong(){


    }




}
